import os
import sys



#
# Directories.
#
PANC_HOME = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PANC_ETC = os.path.join(PANC_HOME, 'etc')
PANC_LOG = os.path.join(PANC_HOME, 'logfiles')
PANC_SRC = os.path.join(PANC_HOME, 'src')



#
# Python paths.
#
if PANC_ETC not in sys.path:
    sys.path.append(PANC_ETC)
if PANC_SRC not in sys.path:
    sys.path.append(PANC_SRC)



#
# Environment variables.
#
# For WSGI.
os.environ['PYTHON_EGG_CACHE'] = '/tmp'

# For Django.
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

# For log.
os.environ['COLLECTIVE_NAME'] = 'panc'
os.environ['COLLECTIVE_DIR'] = PANC_LOG
os.environ['LOG_CONFIG'] = os.path.join(PANC_ETC, 'log.panc.conf')



#
# WSGI application.
#
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


